{extend name="$_admin_public_base_"/}
{block name="style"}
  <style type="text/css">

  </style>
{/block}

{block name="main"}
<section class="content pt-5">
<div class="box box-solid eacoo-box">
    {:logic('admin/AppStore')->getAppStoreTabs('module')}
      <div class="box box-solid">
        <div class="box-header with-border">
            <h3 class="box-title">温馨提示</h3>
            <div class="box-tools">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
            </div>
            <p class="f13 color-6 pt-5">可在线安装、卸载、禁用、启用模块，同时支持本地安装。EacooPHP已上线应用市场，你可以发布你的免费或付费扩展应用：<a href="{:config('eacoo_api_url')}/appstore/modules" target="_blank">{:config('eacoo_api_url')}/appstore/modules</a></p>
        </div>
        <div class="box-body no-padding">
          
        </div>
        <!-- /.box-body -->
      </div>
    <div class="box-body">
        <div class="eacoo-tabs builder-form-tabs">
            <ul class="nav nav-tabs">
                {volist name="tab_list" id="tab"}
                    <li class="{php}if($from_type == $key) echo 'active';{/php}"><a class="reset-appstore-conent" href="{$tab.href}" {$tab.extra_attr|default=''}>{$tab.title}</a></li>
                {/volist}
            </ul>
            <div class="form-group"></div>
        </div>

        <div class="builder-toolbar mt-10 oh">
           <div class="col-xs-12 col-sm-12 button-list clearfix">
              <button class="btn btn-info btn-sm " id="app-localupload"><i class="fa fa-cloud-upload"></i> 本地安装</button>
              <a class="btn btn-success btn-sm ajax-get" href="{:url('admin/modules/refresh')}"><i class="fa fa-refresh"></i> 刷新缓存</a>
              <button class="btn btn-default btn-sm" id="eacoo-userinfo" ><i class="fa fa-user"></i> 会员信息</button>
          </div>
        </div>
        
        <div class="builder formbuilder-box panel-body">

            <div class="row" id="appstore-content">    
              
           </div><!--row-->
         </div>
    </div>
</div>
</section>
<script id="appstore_tpl" type="text/html">
  <% for (var i = 0; i < data.length; i ++) { %>
   <% var row = data[i]; %>
    <div class="col-sm-4 col-xs-6 extension-item">
      <div class="app-item">
        <div class="col-sm-3 col-xs-3 item-logo view-app-detail" data-name="<%= row.name %>" data-type="module" style="cursor: pointer;">{{@row.logo}}</div>
        <div class="col-sm-9 col-xs-9 pr-0" >
            <h4>
            <span class="view-app-detail" data-name="<%= row.name %>" data-type="module" style="cursor: pointer;"><%= row.title %></span>
            <% if (row.mark) { %> <span class="btn bg-maroon margin btn-xs app-meta-mark">推荐</span><% } %>
            <% if (row.from_type=='oneline') { %><span class="fr color-red f12"><% if (row.price>0) { %>¥<%= row.price %><% }else { %>免费<% } %></span><% } %>

            </h4>
          <p class="item-desc"><%= row.description %></p>
          <div class="item-metas">
              <p class="text-muted f13">作者：<a href="{:config('eacoo_api_url')}/appstore_module/<%= row.name %>" target="_blank"><%= row.author %></a></p>
              <p class="text-muted f13">版本：<%= row.version %></p>
          </div>
        </div>
      <p class="oh w pt-10 h40" >
        <% if (row.from_type=='oneline') { %>
        <span class="text-muted f13"><i class="fa fa-star color-warning"></i> <%= row.downloaded %></span>
        <% } else{ %>
        <span class="text-muted">
            <%= row.create_time %>
        </span><% } %>
        <span class="fr">{{@row.right_button}}</span>
      </p>
      </div>
      
    </div>
  <% } %>
  <% if(data.length==0){ %>
    <div class="tc no-found">
      <p>暂无模块，请前往<a href="{:url('index',['from_type'=>'oneline'])}">模块市场</a>下载</p>
    </div>
  <% } %>
</script>
{/block}

{block name="script"}
<script type="text/javascript" src="__LIBS__/artTemplate/template.js"></script>
<script type="text/javascript" src="__ADMIN_JS__/eacoo.extension.js?v={:EACOOPHP_V}" ></script>
<link href="__LIBS__/webuploader/css/webuploader.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="__LIBS__/webuploader/js/webuploader.min.js"></script>
<script>
    var apptype = 'module';
    var from_type = '{:$from_type}';
</script>
{/block}